current_dir=$(pwd)
cd $current_dir
version=6.0.0
server_repo=https://gitee.com/opengauss/openGauss-server.git
plugin_repo=https://gitee.com/opengauss/Plugin.git
git clone $server_repo -b v6.0.0 openGauss-server-$version
git clone $plugin_repo -b v6.0.0 Plugin-$version
cp -rf Plugin-$version/contrib/* openGauss-server-$version/contrib/
rm -rf openGauss-server-$version/contrib/datavec
cd openGauss-server-$version
gitcommit=$(git log 2>/dev/null | grep commit | head -1 | awk '{print $2}' | cut -b 1-8)
echo $gitcommit > ../COMMIT
rm -rf src/test/regress/jar
rm -rf src/test/regress/output
rm -rf src/test/regress/expected
rm -rf src/test/regress/sql
rm -rf src/test/regress/data
rm -rf src/test/regress/jdbc_test
rm -rf src/test/regress/input
rm -rf .git
rm -rf ./docker
cd ..
tar -zcf "openGauss-server-${version}.tar.gz" openGauss-server-$version